package com.itheima.myinner.test;

public class Demo2 {
    public static void main(String[] args) {
        goSwimming(() ->{ System.out.println("wan");});
    }

    public static void goSwimming(Swimming swimming) {
        Swimming swim = new Swimming() {
            @Override
            public void swim() {
                System.out.println("去游戏");
            }
        };
        swimming.swim();
    }
}


interface Swimming {
    void swim();
}